package com.chinaunicom.product.domain.service;

import com.chinaunicom.product.domain.model.entity.ProductSkuEntity;
import com.chinaunicom.product.domain.model.query.ProductSpuQuery;
import com.chinaunicom.product.domain.repository.IProductRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author guomenghuai
 * @date 2024/1/10
 * @Description
 */
@Service
public class ProductService {

    @Resource
    private IProductRepository productRepository;

    public List<ProductSkuEntity> queryProductList(ProductSpuQuery query) {
        return productRepository.queryProductList(query);
    }

    public ProductSkuEntity queryProductDetail(ProductSpuQuery query) {
        return productRepository.queryProductById(query);
    }

    public boolean saveProduct(ProductSkuEntity productSkuEntity) {
        productRepository.saveProduct(productSkuEntity);
        return true;
    }
}
